package com.camunda.workflow.domain.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.camunda.workflow.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import static com.camunda.workflow.common.consts.CommonCst.KEY_GEN;

@ApiModel
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@Table(value = "sys_menu")
public class SysMenu extends BaseEntity {
    @Id(keyType = KeyType.Generator, value = KEY_GEN)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @ApiModelProperty("父ID")
    private Integer pid;
    @ApiModelProperty("中文名称")
    private String name;
    @ApiModelProperty(value = "菜单类型 0 目录 1 菜单 2 权限")
    private Integer type;
    @ApiModelProperty(value = "路由")
    private String router;
    @ApiModelProperty(value = "部件")
    private String component;
    @ApiModelProperty(value = "权限标示 如 duty:manage:query")
    private String auth;
    @ApiModelProperty("图标")
    private String icon;
    @ApiModelProperty(value = "排序字段 值越大越靠前")
    private Integer sort;
}
